<template>
	<view class="">
		<view class="resume_tsfw">
			<u-section title="行业分类" sub-title="更多模板" :show-line="false" font-size="32"></u-section>
			<u-tabs :list="list" :is-scroll="true" :current="current" @change="change" :show-bar="false" active-color="#fff"
			 inactive-color="#B3B3B3" height="60" :bold="false" :active-item-style="{background:'#00C091'}" style="margin:30rpx 0"></u-tabs>
			<view class="resume_list_box">
				<view class="resume_list" v-for="(item,index) in resumelist" :key="index" @click="Goedit(item.mbbm)">
					<image :src="item.slt" mode="widthFix"></image>
				</view>
			</view>
			<u-popup v-model="show" mode="center" border-radius="14" width="500rpx" height="400rpx">
				<view class="" style="padding-top: 30rpx; text-align: center; font-size: 32rpx;font-weight: bold;">
					确认使用简历模板
				</view>
				<u-form :model="form" ref="uForm" style="padding:0 30rpx;">
					<u-form-item label="姓名" prop="xm">
						<u-input v-model="form.xm" />
					</u-form-item>
					<u-form-item label="电话" prop="lxdh">
						<u-input v-model="form.lxdh" />
					</u-form-item>
				</u-form>
				<u-button @click="submit" style="margin:0 30rpx;background-color: rgb(0, 192, 145);color: #fff;">提交</u-button>
			</u-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mbbmmb: "",
				show: false,
				errorType: ['message'],
				list: [{
						name: '制造能源'
					}, {
						name: '消费运送'
					}, {
						name: '医疗制药',
					},
					{
						name: '广告传媒'
					}, {
						name: '教育培训'
					}, {
						name: '休闲服务',
					},
					{
						name: '房地产建筑',
					},
					{
						name: '金融投资',
					},
					{
						name: '互联网通信',
					}
				],
				form: {
					xm: "",
					lxdh: "",
				},
				rules: {

				},
				rslThemeData: {
					"rslTheme1": {
						"leftbox": ["rsclogo", "rscbase"],
						"rightbox": ["rscname", "rsczwpj", "rscwhere", "rscgcal", "rscjyjl", "rscgzjl"]
					},
					"rslTheme2": {
						"topbox": ["rsclogo", "rscname"],
						"bottombox": ["rscbase", "rsczwpj", "rscwhere", "rscgcal", "rscjyjl", "rscgzjl"]
					},
					"rslTheme3": {
						"topbox": ["rsclogo", "rscname"],
						"bottombox": ["rscbase", "rsczwpj", "rscwhere", "rscgcal", "rscjyjl", "rscgzjl"]
					},
					"rslTheme4": {
						"topbox": ["rsclogo", "rscname"],
						"bottombox": ["rscbase", "rsczwpj", "rscwhere", "rscgcal", "rscjyjl", "rscgzjl"]
					},
					"rslTheme5": {
						"topbox": ["rscname", "rsclogo"],
						"leftbox": ["rscbase"],
						"rightbox": ["rsczwpj", "rscwhere", "rscgcal", "rscjyjl", "rscgzjl"],
					},
				
				},
				current: 0
			}
		},
		props: {
			resumelist: {
				type: Array,
				default () {
					return []
				}
			},
		},
		methods: {
			change(index) {
				this.current = index;
				// console.log(this.list[this.current].name)
				this.$emit('myChange', this.list[this.current].name)
			},
			Goedit(mbbm) {
				this.show = true
				this.mbbmmb = mbbm
			},
			async submit() {
				if (this.$store.state.token) {
					let params = {
						ak: this.$store.state.token,
						cmd: 'lPeople_add',
						para: {
							"xm": this.form.xm,
							"lxdh": this.form.lxdh,
							thmid:this.mbbmmb,
							thmconfig:JSON.stringify(this.rslThemeData[this.mbbmmb]),
						}
					}
					const res = await this.$u.api.resumexgdata(params)
					if (res.Data.id) {
						this.$u.route('/pages/HomeLnner/ResumeEdit/ResumeEdit', {
							id: res.Data.id						
						})
					}
				} else {
					this.$u.route('/pages/myuser/user/UserInfo')
				}

			}
		},

	}
</script>

<style scoped lang="scss">
	.resume_tsfw {
		padding: 40rpx 30rpx 0 30rpx;

		.resume_text {
			font-size: 32rpx;
			font-weight: 500;
		}
	}

	/deep/.u-tab-item {
		margin-right: 24rpx;
		background: #F5F5F7;
		border-radius: 29rpx;
		font-size: 30rpx;
	}

	.resume_list_box {
		display: flex;
		justify-content: space-between;
		flex-direction: row;
		flex-wrap: wrap;

		.resume_list {
			width: 47.5%;
			border-radius: 10rpx;
			box-shadow: 0px 0.5px 5px 0px #e6e6e6;
			margin-bottom: 30rpx;
			overflow: hidden;

			image {
				width: 100%;
			}
		}
	}
</style>
